package com.safeluck.scannerqcr.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.view.View;

import com.safeluck.scannerqcr.fragment.pager.FirstPagerFragment;
import com.safeluck.scannerqcr.fragment.pager.OtherPagerFragment;

/**
 * ScannerQCR
 * Created by lzw on 2017/12/4. 13:53:06
 * 邮箱：632393724@qq.com
 * All Rights Saved! Chongqing AnYun Tech co. LTD
 */

public class WechatPagerFragmentAdapter extends FragmentPagerAdapter {

    private String[] mTitles ;

    public WechatPagerFragmentAdapter(FragmentManager fm,String ... args) {
        super(fm);
        mTitles = args;
    }

    @Override
    public Fragment getItem(int position) {
        if (position == 0){
            return FirstPagerFragment.newInstance();
        }else{
            return OtherPagerFragment.newInstance();
        }

    }

    @Override
    public int getCount() {
        return mTitles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitles[position];
    }
}
